import { ADD_COUNT, REDUCE_COUNT } from '@/action/countAction';

const CountData = (state = {
    count: 0,
}, action) => {
    switch (action.type) {
    case ADD_COUNT:
        return {
            ...state,
            count: state.count + 1,
        }
    case REDUCE_COUNT:
        return {
            ...state,
            count: state.count - 1,
        }
    default:
        return state;
    }
}

export default CountData;
